<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="root">

        <h2>歌曲id 歌曲url: {{musicUrl}}</h2>
        <button @click="getData">发送get请求</button>
        <audio controls :src="musicUrl"></audio>
        
    </div>


    <script>
        new Vue ({
            el:'#root',
            data() {
                return {
                    // 歌曲url
                    musicUrl:''
                }
            },
            methods: {
                async getData(){
                    
                    const {data:res} = await axios({
                        method:'get',
                        url:'https://autumnfish.cn//song/url',
                        params:{
                            id:33894312
                        }
                    })
                    this.musicUrl= res.data[0].url
                    console.log(res.data[0].url);
                }
            },
        })
    </script>
</body>
</html>